const {Model, DataTypes} = require('sequelize');
const sequelize = require('../config/db');

class History extends Model {}

History.init({
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true
    },
    period: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: '历史时期'
    },
    region: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: '地区'
    },
    craft_process: {
        type: DataTypes.TEXT,
        allowNull: false,
        comment: '工艺流程'
    },
    cultural_value: {
        type: DataTypes.TEXT,
        allowNull: false,
        comment: '文化价值'
    },
    cultural_background: {
        type: DataTypes.TEXT,
        allowNull: false,
        comment: '文化背景'
    }
}, {
    sequelize,
    modelName: 'history',
    tableName: 'history',
    timestamps: false
});

module.exports = History;